projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4679ab9
)
Used fixed point instead of approximate fp to reduce rounding error on
author
robertl
<robertl>
Tue, 2 Dec 2003 17:54:14 +0000
(17:54 +0000)
committer
robertl
<robertl>
Tue, 2 Dec 2003 17:54:14 +0000
(17:54 +0000)
Garmin waypt xfer.
jeeps/gpsmath.c
patch
|
blob
|
history
diff --git
a/jeeps/gpsmath.c
b/jeeps/gpsmath.c
index bddf5f1dab13b1ddd9659d267624dd875643bc86..9e0bdf802c802bfde1b082db9e98fc94d293c8d7 100644
(file)
--- a/
jeeps/gpsmath.c
+++ b/
jeeps/gpsmath.c
@@
-250,7
+250,7
@@
double GPS_Math_Feet_To_Metres(double v)
int32 GPS_Math_Deg_To_Semi(double v)
{
- return (
int32) (((double)2.147483e9/(double)180)*(double)v)
;
+ return (
(1U<<31) / 180) * v
;
}
@@
-266,7
+266,7
@@
int32 GPS_Math_Deg_To_Semi(double v)
double GPS_Math_Semi_To_Deg(int32 v)
{
- return
(double) (((double)v/(double)2.147483e9) * (double)
180);
+ return
v / (double) ((1U<<31) *
180);
}